body {
  background-color: #eee;
}

.carousel {
  position: absolute;
  inset: 0;
  width: 50%;
  max-width: 900px;
  min-width: 550px;
  margin: auto;
}

.carousel {
  $scrollbarHeight: 4px;
  $scrollbarColor: #d82b6a;
  $carouselHeight: 200px;
  $fadeWidth: 50px;
  $padding: 8px;
  $radius: 8px;
  $bg: white;

  display: block;
  font-size: 0;
  border-radius: $radius;
  padding: $padding;
  box-shadow: 0 4px 10px rgba(black, 0.15);
  background: $bg;
  transform: translateZ(0);
  height: $carouselHeight;
  --webkit-overflow-scrolling: touch;

  &[data-at*="left"] > .wrap {
    &::before {
      opacity: 1;
      text-indent: -50px;
    }
  }
  &[data-at*="right"] > .wrap {
    &::after {
      opacity: 1;
      text-indent: -50px;
    }
  }
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 4;
    bottom: -4px;
    left: 0;
    background-color: $scrollbarColor;
    height: $scrollbarHeight;
    opacity: 0;
    width: var(--scrollWidth, 0);
    left: var(--scrollLeft, 0);
    transition: opacity 0.2s, bottom 0.2s;
  }
  &:hover {
    &::after {
      opacity: 1;
      bottom: -10px;
    }
  }

  .wrap {
    overflow: hidden;
    border-radius: calc($radius - $padding / 2);
    &::before,
    &::after {
      content: "\2039";
      opacity: 0;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 2;
      width: $fadeWidth;
      font-size: 80px;
      text-indent: -30px;
      line-height: $carouselHeight;
      font-family: monospace;
      color: #555;
      font-weight: bold;
      border-radius: $radius;
      pointer-events: none;
      transition: all 0.2s ease-out;
      background: linear-gradient(to right, white 20%, transparent);
    }
    &::after {
      transform: rotate(180deg);
      left: auto;
      right: 0;
    }
    ul {
      list-style: none;
      white-space: nowrap;
      height: $carouselHeight;
      li {
        display: inline-block;
        vertical-align: middle;
        height: 100%;
        margin: 0 0 0 5px;
        position: relative;
        overflow: hidden;
        transition: all 0.2s ease-out;
        &:first-child {
          margin: 0;
        }
        img {
          display: block;
          height: 100%;
          margin: auto;
          //   vertical-align: middle;
          position: relative;
          z-index: 1;
          transition: all 1s;
        }
      }
    }
  }
}
